<template>
	<view>
		<view class="Bill-type">
			<text class="Bill-type-tit" @click="show = true ">全部账单类型∨</text>
		</view>
		<view class="bill-background-box">
			<i class="bill-background-icon"></i>
			<text class="bill-background-tit">暂无薯币账单可以查看</text>
		</view>
		<u-popup :show="show" mode="bottom" @close="close" @open="open">
			<view>
				<view class="Bottom-Kuang">
					<text class="chose-Bottom-Kuang">请选择账单类型</text>
					<view class="choise-box-background">
						<view class="choise-box">
							<view v-for="(item,index) in arr" :key="index" class="Bill-type-box" :class="{ 'selected': selectedIndex === index }" @click="selectOption(index)">{{item.name}}</view>
						</view>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				arr: [{
						name: '全部'
					},
					{
						name: '薯币红包'
					},
					{
						name: '礼物记录'
					},
					{
						name: '充值薯币'
					},
					{
						name: '薯条订单'
					},
					{
						name: '礼物雨订单'
					},
					{
						name: '直播课'
					},
					{
						name: '购物红包'
					},
					{
						name: '主播券'
					},
					{
						name: '主播预约红包'
					},
				],
				selectedIndex: null
			}
		},
		methods: {
			open() {
				// console.log('open');
			},
			close() {
				this.show = false
			},
			selectOption(index) {
			    this.selectedIndex = index;
				this.show = false
			  }
		}
	}
</script>

<style scoped>
	.Bill-type {
		width: 300rpx;
		height: 100rpx;
		margin: auto;
		text-align: center;
		line-height: 100rpx;
	}

	.Bottom-Kuang {
		width: 100%;
		height: 900rpx;
	}

	.chose-Bottom-Kuang {
		display: block;
		text-align: center;
		margin-top: 30rpx;
		letter-spacing: 5rpx;
	}

	.choise-box-background {
		width: 100%;
		height: 640rpx;
		border-bottom: 1rpx solid #fafafa;
	}

	.choise-box {
		width: 100%;
		height: 600rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		margin: 30rpx auto;
		border-top: 1rpx solid #fafafa;

	}

	.Bill-type-box {
		width: 220rpx;
		height: 135rpx;
		background-color: #fafafa;
		margin-top: 20rpx;
		margin-left: 10rpx;
		margin-right: 10rpx;
		border-radius: 25rpx;
		text-align: center;
		line-height: 135rpx;
	}

	.Bill-type-box.selected {
		background-color: red;
		color: white;
	}
	.bill-background-box{
		width: 500rpx;
		height: 500rpx;
		margin:300rpx auto;
	}
	.bill-background-icon{
		display: block;
		width: 300rpx;
		height: 300rpx;
		margin:00rpx auto;
		background-image: url("../../static/icon/cactus01.png");
		background-repeat: no-repeat;
		background-size: cover;
	}
	.bill-background-tit{
		font-size: 35rpx;
		letter-spacing: 5rpx;
		display: block;
		text-align: center;
		margin-top: 35rpx;
		color: #e6e6e6;
	}
</style>